<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" href="../../layui/css/layui1.css">
<link rel="stylesheet" href="../../css/h_main/global.css">
<link rel="stylesheet" href="../../css/Semantic/semantic.min.css">
<script src="../../layui/layui.js"></script>
<style type="text/css">
	.layui-nav-item:hover{
		color:white;
		cursor: pointer;	
	}
</style>
</head>
<body>
	<div id="app">
		<div class="header">
			<div class="main">
				<a href="index.html"
					style="margin-left: 30px; line-height: 65px; color: white; font-size: 18px;">教学管理</a>
				<div class="nav"></div>

				<div class="nav-user">
					<!-- 登入后的状态 -->

					<a class="avatar" href="index.html"> <img :src="url">
						<cite style="color: white;">{{name}}</cite> 
					</a>
					<div class="nav">
						 <a
							href="" @click="eliminate"><i class="layui-icon"
							style="top: 0; font-size: 22px;">&#xe682;</i>退了</a>
					</div>
				</div>
			</div>
		</div>


		<div class="main fly-user-main layui-clear">
			<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
				
				<li class="layui-nav-item " v-for="ss in menus"><a :href="ss.url" target="right">
						<i class="layui-icon" v-html="ss.icon"></i> {{ss.menu_name}}
				</a></li>
			</ul>

			<div class="site-tree-mobile layui-hide">
				<i class="layui-icon">&#xe602;</i>
			</div>
			<div class="site-mobile-shade"></div>

			<div class="fly-panel fly-panel-user">
				<div class="layui-tab layui-tab-brief" lay-filter="user">

					<div class="layui-tab-content"
						style="margin:20px; padding-top: 5px;">
						<iframe width="85%" style="border: 1px dotted #cccccc;  height: 615px" name="right"></iframe>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script src="../../layui/layui.js"></script>
	<script src="../../js/vue/axios.min.js"></script>
	<script src="../../js/vue/vue.js"></script>
	<script>
		layui.use('element', function() {
			var element = layui.element;
		});
	</script>
	<script>
			new Vue({
				el: '#app',
				data() {
					return {
						menus:[],
						account_id:0,//用户id
						name:'',//登录用户名
						url:'',//头像
					}
				},
				mounted:function(){
					this.menu();
					this.accountShow();
				},
				methods:{
					menu:function(){
						axios.get('/menu/findAll?limit=99').then(res=>{
							var o=res.data.list
							this.menus=o;
						},err=>{
							console.log(err);
						});
					},
					accountShow:function(){
							axios.get('/account/extract').then(res=>{
								var o=res.data.data;
								console.log(res.data.data);
								this.name=o.name;
								this.url=o.url;
							},err=>{
								console.log(err);
							});
					},
					eliminate:function(){
						axios.get('/account/eliminate').then(res=>{
							location.href='../account/login.html';
						},err=>{
							console.log(err);
						});
					}
				}
			})
		</script>
</body>
</html>